export default {
  namespaced:true,
  state:()=>({
    // 用户地址信息
       address: JSON.parse(uni.getStorageSync('address') || '{}'),
  }),
   mutations:{
     // 更新用户地址信息
       updateAddress(state, address) {
         state.address = address
         this.commit('m_user/saveToStorage')
       },
       saveToStorage(state) {
         uni.setStorageSync('address', JSON.stringify(state.address))
       }
   },
   
   getters:{
     addstr(state){
       if(!state.address.provinceName)return ''
         // 拼接地址信息
           return state.address.provinceName + state.address.cityName + state.address.countyName + state.address.detailInfo
     }
   }
}